"""
认证模块配置

包含认证模块的特定配置设置，与主应用配置分离。
"""

from typing import Dict, Any
from pydantic import BaseModel

from app.core.config import settings as app_settings


class AuthSettings(BaseModel):
    """认证模块特定配置"""
    
    # 模块通用配置
    MODULE_NAME: str = "Authentication"
    API_PREFIX: str = "/auth"
    
    # 令牌配置
    ACCESS_TOKEN_EXPIRE_MINUTES: int = app_settings.ACCESS_TOKEN_EXPIRE_MINUTES
    RESET_TOKEN_EXPIRE_HOURS: int = 24
    EMAIL_VERIFY_TOKEN_EXPIRE_HOURS: int = 48
    
    # 密码策略
    PASSWORD_MIN_LENGTH: int = 8
    PASSWORD_MAX_LENGTH: int = 64
    PASSWORD_REQUIRE_UPPERCASE: bool = True
    PASSWORD_REQUIRE_LOWERCASE: bool = True
    PASSWORD_REQUIRE_DIGIT: bool = True
    PASSWORD_REQUIRE_SPECIAL: bool = True
    
    # 邮件配置
    EMAIL_VERIFICATION_REQUIRED: bool = False  # 是否需要邮箱验证
    
    # 注册配置
    ALLOW_REGISTRATION: bool = True  # 是否允许新用户注册
    
    def get_full_api_prefix(self) -> str:
        """获取包含API版本的完整API前缀"""
        return f"{app_settings.API_V1_STR}{self.API_PREFIX}"


# 创建认证配置实例
settings = AuthSettings() 